﻿<UserControl x:Class="Peter.Sdw.View.LinkEditView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:logic="clr-namespace:Peter.Sdw.Logic"
             xmlns:icons="clr-namespace:Peter.Common.Icons;assembly=Peter.Common"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300"
             d:DataContext="{d:DesignInstance logic:LinkModel}">
   <Grid>
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="*" />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
         <ColumnDefinition Width="*" />
         <ColumnDefinition Width="150" />
         <ColumnDefinition Width="*" />
      </Grid.ColumnDefinitions>

      <Grid Grid.Row="0"
            Grid.RowSpan="2"
            Grid.Column="1"
            Margin="5,0">
         <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
         </Grid.RowDefinitions>

         <Button Grid.Row="0"
                 CommandParameter="add"
                 Command="{Binding Path=LinkCommand}">
            <StackPanel Orientation="Horizontal">
               <icons:IconDisplay Icon="ChevronLeft" />
               <icons:IconDisplay Icon="PlusSign"
                                  Margin="4,0" />
               <TextBlock Text="Add Link" />
            </StackPanel>
         </Button>
         <Button Grid.Row="1"
                 CommandParameter="edit"
                 Command="{Binding Path=LinkCommand}">
            <StackPanel Orientation="Horizontal">
               <icons:IconDisplay Icon="Edit" />
               <TextBlock Text="Save Link"
                          Margin="4,0" />
               <icons:IconDisplay Icon="ChevronRight" />
            </StackPanel>
         </Button>
         <Button Grid.Row="2"
                 CommandParameter="delete"
                 Command="{Binding Path=LinkCommand}">
            <StackPanel Orientation="Horizontal">
               <icons:IconDisplay Icon="Remove" />
               <TextBlock Text="Delete Lnk"
                          Margin="4,0" />
               <icons:IconDisplay Icon="ChevronRight" />
            </StackPanel>
         </Button>
      </Grid>

      <TextBlock Grid.Row="0"
                 Grid.Column="2"
                 FontWeight="Bold"
                 Text="Current Links" />

      <ListBox Grid.Row="1"
               Grid.Column="2"
               DisplayMemberPath="DisplayText"
               ItemsSource="{Binding Path=Links}"
               SelectedItem="{Binding Path=SelectedLink}" />
      
   </Grid>
</UserControl>
